package com.principle.singleresponsibility;

/**
 * 单一职责原则举例1
 * 下面是不遵守单一职责原则所出现的问题
 * @author mxs
 */
public class Responsibility1 {
    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("car");
        vehicle.run("plane");
    }
}

/**
 * 交通工具类
 */
class Vehicle{
    public void run(String vehicle){
        System.out.println(vehicle+" can run");
    }
}
